﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AbstractTesting
{
    class InMemoryFileSystem
    {

        enum FileSystemType
        { 
            File,
            Folder
        }

        abstract class FileSystemItem : IComparable
        {
            public FileSystemItem(string name, FileSystemType fileSystemType)
            {
                Name = name;
                Type = fileSystemType;
            }
            public string Name;
            FileSystemType Type;
            public int CompareTo(object obj)
            {
                return Name.CompareTo((obj as FileSystemItem).Name);
            }
        }

        class File : FileSystemItem
        {
            public File(string name) : base(name, FileSystemType.File) {}
            public byte[] Contents;
        }

        class Folder : FileSystemItem
        {
            public Folder(string name) : base(name, FileSystemType.Folder) { }
            Folder ParentFolder;
            SortedSet<Folder> Folders;
            SortedSet<File> Files;

            //public void AddSubFolder(Folder folder);
            //public void RemoveSubFolder(Folder folder);
            //public Folder GetSubFolder(string FolderName);
        }

        class FileSystem
        {
            Folder RootFolder = new Folder("Root");
            Folder CurrentFolder;
        }
    }
}
